home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
boe.pres.k12.wv.us
/
boe.pres.k12.wv.us.zip
/
boe.pres.k12.wv.us
/
Utilities
/
Xerox Workcentre 5335
/
Windows Scan
/
64-bit_x64
/
Russian
/
cpsimage.cab
/
data
/
sys
/
datetime.elf
< prev
next >
Wrap
Text File
|
2009-04-23
|
2KB
|
58 lines
/*
** $Id: datetime.elf,v 1.4 2009/04/20 20:49:13 isimmons Exp $
*/
/******************************************************************************/
/*
** This class provides access to date and time on the system. See elfmiscsys.c.
*/
/* @New
// DESCRIPTION
Creates a new instance of DATETIME to specified date and time. Any value not given
will default to its corresponding value in the Epoch, January 1, 1970 00:00:00 GMT.
//Example
#load "sys/datetime.elf";
DATETIME dt = DATETIME.now (utc: TRUE);
STRING time = dt.toString ();
DATETIME dt = new (DATETIME, year:2010, hour:15, min:15, sec:15);
print dt.toString ();
// Note the setDateTime is static time, i.e., does not increment time.
*/
/* @now Creates a new instance with the current time and date in local time or Coordinated Universal Time (UTC).*/
/* @toLocalTime Convert value of this instance to local time. */
/* @toUTC Convert value of this instance to Coordinated Universal Time (UTC). */
/* @toString Convert value of this instance to its equivalent string representation using specified format string. */
/******************************************************************************/
CLASS DATETIME {
STRING HTTP_FORMAT = "EEE', 'dd' 'MMM' 'YYYY' 'HH':'mm':'ss' GMT'";
STRING W3C_FORMAT = "YYYY'-'MM'-'dd'T'HH':'mm':'ssZZ";
STRING W3CZ_FORMAT = "YYYY'-'MM'-'dd'T'HH':'mm':'ss'Z'";
METHOD New( INTEGER year, INTEGER month, INTEGER day,
INTEGER hour, INTEGER min, INTEGER sec, BOOLEAN utc )
NATIVE "ElfDateTimeMethods@builtins";
METHOD Free() NATIVE "ElfDateTimeMethods@builtins";
METHOD Empty() RETURNS (BOOLEAN empty)
NATIVE "ElfDateTimeMethods@builtins";
METHOD now( BOOLEAN utc ) RETURNS (DATETIME dt)
NATIVE "ElfDateTimeMethods@builtins";
METHOD getTime() RETURNS ( LONG time )
NATIVE "ElfDateTimeMethods@builtins";
METHOD toLocalTime() RETURNS (DATETIME dt)
NATIVE "ElfDateTimeMethods@builtins";
METHOD toUTC() RETURNS (DATETIME dt)
NATIVE "ElfDateTimeMethods@builtins";
METHOD toString( STRING format ) RETURNS (STRING timestamp)
NATIVE "ElfDateTimeMethods@builtins";
}